function findChild(arr,fatherId){
    let arrChild=[]
    arr.forEach((item,i)=>{
        if(item.pid==fatherId){
            arrChild.push(item)
        }
    })
    return arrChild
  
}
function getTree(arr,fatherId){
    let data=findChild(arr,fatherId)
    if(data.length<=0){
        return null
    }
    data.forEach((item,i)=>{
        if(item.id){
        item.children=getTree(arr,item.id)
    }
    })
   return data   

}